<!--
 * @Author: your name
 * @Date: 2020-10-18 09:41:13
 * @LastEditTime: 2020-10-18 18:17:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue3\src\views\day\index.vue
-->
<template>
  <div class="container">
   <day-card :data="result"></day-card>
   <day-list :data="result"></day-list>
<button @click="getuser">请求</button>
<!-- <pre>{{data}}</pre> -->
  </div>
</template>

<script>
import {getData} from '@/api/user.js'
import DayList from '@/components/dayPage/list'

import {onMounted,reactive,reactvie, toRefs} from "vue"
import DayCard from '@/components/dayPage/card'
import {useStore} from 'vuex'
export default {
    name:"DayPage",
    components:{DayCard,DayList},
    setup(){
        const store=useStore()
       const state=store.state;
        const data=reactive({
            result:{}
        })
        
        onMounted( async()=>{
          const {result}=await getData({
                date:"2015-1-1"
            })
             console.log("===",result);
          data.result=result.data
          
        })
      
       return {...toRefs(data)}
    }
    
}
</script>

<style lang="scss" scope>

</style>